import '../pages/order/FinishTask.dart';
import '../pages/order/LaunchTask.dart';

import '../pages/order/HistoryTask.dart';
import '../pages/order/WaitDoTask.dart';
import '../pages/order/TodoTask.dart';
import 'package:flutter/material.dart';
import '../pages/order/Verify.dart';
import '../pages/test/HeadTest.dart';

import '../pages/Tabs.dart';
import '../pages/LoginCode.dart';
import '../pages/person/Login.dart';
import '../pages/person/Setting.dart';
import '../util/WebViewUtil.dart';
import '../util/WebViewExample.dart';
import '../pages/person/ChangeCode.dart';






/*
 * 配置路由
* */
final routes = {
  '/': (context) => Tabs(),
//  '/form': (context) => FormPage(),
  '/LoginCode': (context) => LoginCode(),
  '/VerifyPage': (context) => VerifyPage(),
  '/ChangeCodePage': (context, {arguments}) => ChangeCodePage(arguments: arguments),
  '/HeadTest': (context) => HeadTest(),
  '/SettingPage': (context) => SettingPage(),
  '/LoginPage': (context) => LoginPage(),
  '/todoTaskPage': (context) => TodoTaskPage(),
  '/waitDoTaskPage': (context) => WaitDoTaskPage(),
  '/historyTaskPage': (context) => HistoryTaskPage(),
  '/finishTaskPage': (context) => FinishTaskPage(),
  '/launchTaskPage': (context) => LaunchTaskPage(),

  '/webViewUtilPage': (context, {arguments}) => WebViewUtilPage(arguments: arguments),
  '/WebViewExample': (context, {arguments}) => WebViewExample(arguments: arguments),



//  '/productinfo': (context, {arguments}) => ProductInfoPage(arguments: arguments),


};

//固定写法
var onGenerateRoute = (RouteSettings settings) {
  // 统一处理
  final String name = settings.name;
  final Function pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    if (settings.arguments != null) {
      final Route route = MaterialPageRoute(
          builder: (context) =>
              pageContentBuilder(context, arguments: settings.arguments));
      return route;
    } else {
      final Route route =
          MaterialPageRoute(builder: (context) => pageContentBuilder(context));
      return route;
    }
  }
};
